package model.wrap.type;

import model.wrap.node.Node;
import models.UserContent;

public class UserElement
{
    protected UserContent element;

    public UserElement(Node node)
    {
	this.element = new UserContent();
	this.element.setId_node(node.getId());
	this.element.setId_structure(node.getStructure().getId());
	this.element.setId_type(node.getType().getID());
	this.element.setContent("");
    }

    public Long getId()
    {
	return this.element.getId();
    }

    public void save()
    {
	this.element.save();
    }

    /**
     * Create User element with default value.
     * 
     * @param Node
     * @return Return user element.
     */
    public static UserElement createDefaultValueForNode(Node node)
    {
	UserElement element = new UserElement(node);
	element.save();
	return element;
    }
}
